package com.appwoo.txtws.service;

import android.content.Context;
import android.util.Xml;
import com.appwoo.android.exception.NotFoundNetWorkException;
import com.appwoo.android.exception.TimeOutException;
import com.appwoo.android.util.DateHelper;
import com.appwoo.android.util.PullIO;
import com.appwoo.txtws.bean.Limit_WebBean;
import com.appwoo.txtws.bean.Record_SoftBean;
import com.appwoo.txtws.bean.Record_WebBean;
import com.appwoo.txtws.bean.StateBean;
import com.appwoo.txtws.bean.WebTypeBean;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.component.Logger;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class WebLimitService
{
  public StateBean addLimitUrl(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "ADUrlRuleSelf</TYPE></HEAD><BODY><BID>073188888888</BID><List>" + "<UrlBlack>" + paramString3 + "</UrlBlack></List></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public StateBean addLimitUrl(String paramString1, String paramString2, String paramString3, String paramString4, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    StateBean localStateBean = new StateBean();
    String str = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "ADUrlRuleSelf</TYPE></HEAD><BODY><BID>" + paramString3 + "</BID><List>" + "<UrlBlack>" + paramString4 + "</UrlBlack></List></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localStateBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }

  public List<Record_SoftBean> getGameBlackList(String paramString1, String paramString2, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    Object localObject1 = null;
    Record_SoftBean localRecord_SoftBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><RCVR>SYS</RCVR>" + "<SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>RQGameRuleSelf</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><GameType>ALL</GameType><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>";
    Logger.i("TXTW", "MSG === " + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      Logger.i("TXTW", "xmlPullParser==" + ((XmlPullParser)localObject2).getName());
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecord_SoftBean = new Record_SoftBean();
      if (localRecord_SoftBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("GameType"))
        {
          localRecord_SoftBean.setType(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("GameName"))
        {
          localRecord_SoftBean.setGameName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("ProcName"))
        {
          localRecord_SoftBean.setProcName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Author"))
        {
          localRecord_SoftBean.setAuthor(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UpdateTime"))
        {
          localRecord_SoftBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Path"))
        {
          localRecord_SoftBean.setPath(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("SHA1"))
        {
          localRecord_SoftBean.setSha1(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")) && (localObject1 != null) && (localRecord_SoftBean != null))
          {
            ((List)localObject1).add(localRecord_SoftBean);
            localRecord_SoftBean = null;
          }
        }
    }
  }

  public List<Record_WebBean> getQTopWrite(String paramString1, String paramString2, String paramString3, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    if ((paramString3 == null) || ("".equals(paramString3)))
      paramString3 = DateHelper.getNowDate();
    Record_WebBean localRecord_WebBean = null;
    MsgService localMsgService = new MsgService();
    Object localObject1 = null;
    String str = localMsgService.sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlAccess</TYPE></HEAD><BODY><DataDate>" + paramString3 + "</DataDate><Allowed>2</Allowed><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localRecord_WebBean = new Record_WebBean();
      if (localRecord_WebBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Url"))
        {
          localRecord_WebBean.setUrl(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Allowed"))
        {
          localRecord_WebBean.setAllowed(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("Num"))
        {
          localRecord_WebBean.setNum(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("VisitedTime"))
        {
          localRecord_WebBean.setVisitedTime(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")) && (localObject1 != null) && (localRecord_WebBean != null))
          {
            ((List)localObject1).add(localRecord_WebBean);
            localRecord_WebBean = null;
          }
        }
    }
  }

  public Limit_WebBean getUrlListByType(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    Limit_WebBean localLimit_WebBean = new Limit_WebBean();
    String str = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlRuleSelf</TYPE></HEAD><BODY><UserID>" + paramString1 + "</UserID><UrlType>" + paramString3 + "</UrlType></BODY></MSG>", paramContext);
    Object localObject = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject = localXmlPullParser;
      i = ((XmlPullParser)localObject).getEventType();
      if (i == 1)
        return localLimit_WebBean;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject).next();
      break;
      localLimit_WebBean = new Limit_WebBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UserID"))
        localLimit_WebBean.setUserID(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UrlBlack"))
        localLimit_WebBean.setUrlBlack(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("UpdateTime"))
        localLimit_WebBean.setUpdateTime(((XmlPullParser)localObject).nextText());
    }
  }

  public List<WebTypeBean> getWebBlackList(String paramString1, String paramString2, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    Object localObject1 = null;
    WebTypeBean localWebTypeBean = null;
    MsgService localMsgService = new MsgService();
    String str1 = "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR><RCVR>SYS</RCVR>" + "<SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>RQUrlRuleSelf</TYPE></HEAD><BODY><UserID>" + paramString2 + "</UserID><UrlType>ALL</UrlType></BODY></MSG>";
    Logger.i("TXTW", "MSG === " + str1);
    String str2 = localMsgService.sendMessage(paramString1, str1, paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localWebTypeBean = new WebTypeBean();
      if (localWebTypeBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UrlBlack"))
        {
          localWebTypeBean.setURL(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UrlName"))
        {
          localWebTypeBean.setTypeName(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("UrlType"))
        {
          localWebTypeBean.setType(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("list")) && (localObject1 != null) && (localWebTypeBean != null))
          {
            ((List)localObject1).add(localWebTypeBean);
            localWebTypeBean = null;
          }
        }
    }
  }

  public List<WebTypeBean> getWebType(String paramString1, String paramString2, int paramInt, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    Object localObject1 = null;
    WebTypeBean localWebTypeBean = null;
    String str = new MsgService().sendMessage(paramString1, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "RQUrlType</TYPE></HEAD><BODY><BID>" + paramString2 + "</BID><DataDate>" + DateHelper.getNowDate() + "</DataDate><PageIndex>" + paramInt + "</PageIndex><PageSize>" + 10 + "</PageSize></BODY></MSG>", paramContext);
    Object localObject2 = Xml.newPullParser();
    int i;
    try
    {
      XmlPullParser localXmlPullParser = PullIO.getPullByString(str);
      localObject2 = localXmlPullParser;
      i = ((XmlPullParser)localObject2).getEventType();
      if (i == 1)
        return localObject1;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (true)
        localNullPointerException.printStackTrace();
      switch (i)
      {
      case 1:
      default:
      case 0:
      case 2:
      case 3:
      }
    }
    while (true)
    {
      i = ((XmlPullParser)localObject2).next();
      break;
      localObject1 = new ArrayList();
      continue;
      if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("List"))
        localWebTypeBean = new WebTypeBean();
      if (localWebTypeBean != null)
        if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeID"))
        {
          localWebTypeBean.setTypeId(((XmlPullParser)localObject2).nextText());
        }
        else if (((XmlPullParser)localObject2).getName().equalsIgnoreCase("TypeName"))
        {
          localWebTypeBean.setTypeName(((XmlPullParser)localObject2).nextText());
          continue;
          if ((((XmlPullParser)localObject2).getName().equalsIgnoreCase("List")) && (localObject1 != null) && (localWebTypeBean != null))
          {
            ((List)localObject1).add(localWebTypeBean);
            localWebTypeBean = null;
          }
        }
    }
  }

  public StateBean reduceLimitUrl(String paramString1, String paramString2, String paramString3, Context paramContext)
    throws IOException, XmlPullParserException, TimeOutException, NotFoundNetWorkException
  {
    String[] arrayOfString = paramString3.split(",");
    String str1 = "";
    int i = arrayOfString.length;
    int j = 0;
    StateBean localStateBean;
    Object localObject;
    int k;
    while (true)
    {
      String str2;
      if (j >= i)
      {
        localStateBean = new StateBean();
        str2 = new MsgService().sendMessage(paramString1, paramString2, "<?xml version=\"1.0\" encoding=\"utf-8\" ?><MSG><HEAD><SNDR>" + paramString1 + "</SNDR> <RCVR>SYS</RCVR>" + " <SEQN>1</SEQN><DTTM>" + GetDateTime.getDateTime() + "</DTTM><TYPE>" + "DLUrlRuleSelf</TYPE></HEAD><BODY>" + str1 + "</BODY></MSG>", paramContext);
        localObject = Xml.newPullParser();
      }
      try
      {
        XmlPullParser localXmlPullParser = PullIO.getPullByString(str2);
        localObject = localXmlPullParser;
        k = ((XmlPullParser)localObject).getEventType();
        if (k == 1)
        {
          return localStateBean;
          String str3 = arrayOfString[j];
          str1 = str1 + "<List><UrlBlack>" + str3 + "</UrlBlack></List>";
          j++;
        }
      }
      catch (NullPointerException localNullPointerException)
      {
        while (true)
          localNullPointerException.printStackTrace();
        switch (k)
        {
        case 1:
        default:
        case 0:
        case 2:
        }
      }
    }
    while (true)
    {
      k = ((XmlPullParser)localObject).next();
      break;
      localStateBean = new StateBean();
      continue;
      if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Code"))
        localStateBean.setCode(((XmlPullParser)localObject).nextText());
      else if (((XmlPullParser)localObject).getName().equalsIgnoreCase("Desc"))
        localStateBean.setDesc(((XmlPullParser)localObject).nextText());
    }
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.service.WebLimitService
 * JD-Core Version:    0.6.2
 */